A number of computer applications may need to determine the accurate local time for a computing device, such as a personal computer, a personal digital assistant (PDA), or a smartphone. For example, e-mail applications generally timestamp messages, and such timestamps may be important for verifying when a message was sent, e.g., if a deadline is set for midnight at a time local to the user. Likewise, on-line billing systems may need an accurate local time for a user, such as when the user needs to establish that a purchase or other transaction was completed before midnight on December 31 for tax purposes. In addition, calendar or scheduling programs need to express the time for meetings in terms of a local time for each attendee of the meeting.
Time zones are generally based on 24 vertical bands that span 15 degrees of the circumference around the earth (with the bands narrowing to points at the poles). Determining a local time zone is not as simple as determining a longitude of a computing device and matching it to one of the 24 bands, because those 24 bands do not actually define the real-world time zones. Rather, time zones are selected politically—typically to match political boundaries such as state or national borders. In general, most locales lie in or to the West of the putative time zone band. As such, some time zones may cover areas that appear to be essentially arbitrary at first look.
Daylight savings time introduces yet another wrinkle into accurate local time determination. Specifically, daylight savings time results in the time in an area shifting suddenly by one hour (“Spring forward; Fall back.”). However, some areas (e.g., Arizona and parts of Indiana) do not recognize daylight savings time at all, so their time zones appear to shift relative to areas that do recognize daylight savings time. Also, some areas recognize daylight savings time on different dates than do other areas. These differences become more pronounced when one looks across different countries—producing several hundred different time zones in the world. And they become even more complicated when jurisdictions change their time zone rules, such as Brazil, which announces its daylight savings time rules annually, so that databases of time zones may quickly become out-of-date.